'use strict';
const child_process = require('child_process');

var list = require('./index')(
  /* possible configs */
  {
    pointer: ' ▸ ',
    pointerColor: 'yellow',
    checked: ' ◉  ',
    unchecked:' ◎  ',
    checkedColor: 'blue',
    msgCancel: '',
    multiSelect: false,
    inverse: true,
    prepend: true
  }
);

var stream = process.stdin;

function exec(){

}

list
    .option('component')
    .option('view')
    // .option('module-form')
    // .option('module-list')
    // .option('module-list-not-paging')
    .list();

list.on('select', function(options){
    console.log('select', options);
    var value = options[0].value;
    child_process.fork('./template/' + value + '/index.js');
});

list.on('cancel', function(options){
  console.log('取消创建！');
  process.exit(0);
});
